package kr.hyunist.androidcomplete01saeildamil.ch07;

import android.app.*;
import android.content.*;
import android.graphics.*;
import android.os.*;
import android.view.*;

public class CustomView extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		MyView mv = new MyView(this);

		setContentView(mv);
	}

	class MyView extends View {

		public MyView(Context context) {
			super(context);

		}

		@Override
		protected void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			canvas.drawColor(Color.LTGRAY);
			Paint pnt = new Paint(Paint.ANTI_ALIAS_FLAG);
			pnt.setColor(Color.BLUE);
			canvas.drawCircle(100, 100, 80, pnt);
			pnt.setColor(Color.RED);
			canvas.drawText("테스트", 200, 200, pnt);
			
			pnt.setColor(Color.BLACK);
			canvas.drawOval(new RectF(10, 10, 200, 120), pnt);
			canvas.drawText("AntiAlias Test", 210, 70, pnt);

			pnt.setColor(Color.GRAY);
			//pnt.setAntiAlias(true);
			canvas.drawOval(new RectF(10, 130, 200, 240), pnt);
			canvas.drawText("AntiAlias Test", 210, 190, pnt);
			
			pnt.setStyle(Paint.Style.FILL);
			canvas.drawCircle(200, 300, 50, pnt);
			
			pnt.setStyle(Paint.Style.FILL_AND_STROKE);
			canvas.drawCircle(300, 300, 50, pnt);
		}

	}
}
